package com.anjbo.common;

/**
 * 项目中定义的枚举
 * @author limh limh@zxsf360.com
 * @date 2016-6-2 下午07:12:05
 */
public class Enums {
	/**
	 * GLOBAL_CONFIG_KEY classpath:config.properties 对应的key
	 * @author Jerry
	 * @version v1.0 Enums.java 2013-9-25 上午11:16:02
	 */
	public enum GLOBAL_CONFIG_KEY {
		/**ams地址**/
		AMS_URL,
		TOOLS_URL,//工具地址
		/**ip白名单**/
		AMS_SMS_IPWHITE,
		/**图片上传地址**/
		FS_URL
	}
	
	/**
	 * 评估状态
	 * @author limh limh@anjbo.com   
	 * @date 2016-12-29 下午09:48:43
	 */
	public enum AssessStatusEnum {
		ASSESSING(1,"评估中"),
		ASSESSSUCCESS(2,"评估成功"),
		ASSESSFAIL(3,"评估失败");
		
		private int code;
		private String name;
		
		AssessStatusEnum(int code, String name) {
			this.code = code;
			this.name = name;
		}

		public int getCode() {
			return code;
		}

		public void setCode(int code) {
			this.code = code;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public static String getNameByCode(int code) {
			String name = "";
			for (AssessStatusEnum roleEnum : AssessStatusEnum.values()) {
				if (roleEnum.getCode() == code) {
					name = roleEnum.getName();
					break;
				}
			}
			return name;
		}
	}
	
	/**
	 * 贷款状态
	 * @author limh limh@anjbo.com   
	 * @date 2016-12-29 下午09:48:43
	 */
	public enum LoanStatusEnum {
		CLOSED(-1,"已关闭"),
		NOSUBMIT(0,"未提交"),
		AUDITING(10,"审批中"),
		AUDITFAIL(20,"审批失败"),
		LENDING(30,"放款中"),
		LENDFAIL(40,"放款失败"),
		LENDED(50,"已放款");
		
		private int code;
		private String name;
		
		LoanStatusEnum(int code, String name) {
			this.code = code;
			this.name = name;
		}

		public int getCode() {
			return code;
		}

		public void setCode(int code) {
			this.code = code;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public static String getNameByCode(int code) {
			String name = "";
			for (LoanStatusEnum roleEnum : LoanStatusEnum.values()) {
				if (roleEnum.getCode() == code) {
					name = roleEnum.getName();
					break;
				}
			}
			return name;
		}

	}
	
	/**
	 * 建行交易号枚举
	 * @author limh limh@anjbo.com   
	 * @date 2016-12-30 下午04:57:07
	 */
	public enum CCBTranNoEnum {
		C008("C008","评估申请"),
		C005("C005","存量客户查询交易"),
		C009("C009","评估结果反馈"),
		C001("C001","房贷通客户信息新增"),
		C002("C002","房贷通贷款信息新增"),
		C015("C015","审批结果反馈"),
		C013("C013","放款反馈"),
		C012("C012","意见反馈");
		
		private String code;
		private String name;
		
		CCBTranNoEnum(String code, String name) {
			this.code = code;
			this.name = name;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public static String getNameByCode(String code) {
			String name = "";
			for (CCBTranNoEnum roleEnum : CCBTranNoEnum.values()) {
				if (roleEnum.getCode().equals(code)) {
					name = roleEnum.getName();
					break;
				}
			}
			return name;
		}
	}
}
